package DuoTaiBase;

public class TestBasic {
    public static void main(String[] args) {
    Animal a =new Dog();//将狗对象当做动物来看，有俩种状态:狗和动物
        System.out.println(a.breed);
        System.out.println(a.sex);
        System.out.println(a.age);
        Dog dog = new Dog();//将狗对象当成狗来看
        System.out.println(dog.sex);
        System.out.println(dog.age);
        System.out.println(dog.breed);
        System.out.println(dog.sex);
    }
}
class Animal{
    String breed;
    int age;
    String sex;
    public void eat(){}
    public void sleep(){}
}
class Dog extends  Animal{
    String Color;
    public void run(){}
}

